package com.rtf.framework.monitor.config;

import com.rtf.framework.monitor.rest.AppMonitorController;
import com.rtf.framework.monitor.support.AppUrlTraceInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

@Slf4j
@Order(Ordered.HIGHEST_PRECEDENCE)
@Configuration
@EnableConfigurationProperties(AppMonitorProperties.class)
public class AppMonitorAutoConfiguration {

    @Bean
    public AppUrlTraceInterceptor appUrlTraceInterceptor(){
        return new AppUrlTraceInterceptor() ;
    }

    @Bean
    public AppMonitorController appMonitorController(){
        return new AppMonitorController() ;
    }


}
